home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / misc / toolbox.lha / Toolbox / lib / rex / Source.def < prev    next >
Encoding:
Text File  |  1993-03-11  |  1.0 KB  |  34 lines

  1. (* $Id: Source.md,v 1.4 1992/08/07 15:29:41 grosch rel $ *)
  2.  
  3. $@ DEFINITION MODULE $Source;
  4.  
  5. FROM SYSTEM    IMPORT ADDRESS;
  6. FROM System    IMPORT tFile;
  7.  
  8. PROCEDURE BeginSource (FileName: ARRAY OF CHAR): tFile;
  9.  
  10.    (*
  11.       BeginSource is called from the scanner to open files.
  12.       If not called then input is read form standard input.
  13.    *)
  14.  
  15. PROCEDURE GetLine (File: tFile; Buffer: ADDRESS; Size: CARDINAL): INTEGER;
  16.  
  17.    (*
  18.       GetLine is called to fill a buffer starting at address 'Buffer'
  19.       with a block of maximal 'Size' characters. Lines are terminated
  20.       by newline characters (ASCII = 0xa). GetLine returns the number
  21.       of characters transferred. Reasonable block sizes are between 128
  22.       and 2048 or the length of a line. Smaller block sizes -
  23.       especially block size 1 - will drastically slow down the scanner.
  24.    *)
  25.  
  26. PROCEDURE CloseSource (File: tFile);
  27.  
  28.    (*
  29.       CloseSource is called from the scanner at end of file or
  30.       at end of input, respectively. It can be used to close files.
  31.    *)
  32.  
  33. $@ END $Source.
  34.